package cn.edu.ctbu.secondclass.repository;

import cn.edu.ctbu.secondclass.domain.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StudentRepository extends JpaRepository<Student,Integer>{


    List<Student> findByNameLike(String name);

    /*
    按名字和密码查询
     */

    List<Student> findByNameAndPassword(String name, String password);
    @Query("Select a from db_student  a where a.no = (select MAX(b.no) from db_student b)")
    List<Student> getTeachersByMaxNo();
}

